package edu.pku.hawk.controller.detectmonitor;

import edu.pku.hawk.controller.util.Constants;
import edu.pku.hawk.controller.util.MProducerQueue;
import edu.pku.hawk.controller.util.MQManager;
import edu.pku.hawk.controller.util.SerResource;
import edu.pku.hawk.controller.util.SerResourceList;

public class SendSample1 {

	public static void main(String[] args) {
		SendSample1 ss = new SendSample1();
		ss.send();
	}

	private MQManager mgr;

	public SendSample1() {

		try {
			mgr = new MQManager(Constants.MQServer_Name, Constants.MQServer_Password, Constants.MQServer_URL);
			mgr.createProducerQueue(Constants.Ctrl_UI_Proc_QueueName);
		} catch (Exception ex) {
			ex.printStackTrace();
		}

	}

	public void send() {

		SerResourceList sr = new SerResourceList();
		sr.ResourceList.add(new SerResource());
		// ....
		

		try {
			MProducerQueue queue = mgr.getProducerQueue(Constants.Ctrl_UI_Proc_QueueName);
			queue.send(sr);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}
	

}
